<div class="out ruleadd2" >
	<div class="col-sm-2 text-right ">
		<span class="title">活动详情</span>
	</div>
	<div class="col-sm-10 content2 mb0">
			<div class="row">
				<div  ng-repeat="(key, detail) in posts.COUPON.COUPON.detail">
					<div class="form-group mb15"  ng-repeat="details in detail" ng-init="details.id=key">
						<div class="row">
							<div class="col-sm-3">
								<select ng-model="details.id"   class="form-control"
								ng-options="item.id as item.name for item in view.member" name="member" required></select>
							</div>
							<div class=" form-control-static pull-left col-sm-2">单次消费每满</div>
							<div class="col-sm-2">
								<input ng-model="details.amount" type="number" class="form-control" min="1" required/>
							</div>
							<div class=" form-control-static col-sm-3">元，赠送</div>
							<div class="col-sm-2 text-right">
								<a class="add click" ng-if="$parent.$first&&$first" ng-click="view.rules.COUPON.addFunc('COUPON')"> <i class="glyphicon glyphicon-plus"></i>
								</a>
								<a class="remove click" ng-if="!$first||!$parent.$first" ng-click="ruleFn.removeFn('COUPON',key,$index)"> <i class="glyphicon glyphicon-remove"></i>
								</a>
							</div>
						</div>

						<div class="col-sm-12">
							<div class="col-sm-8 mt15" ng-repeat="dv in details.value">
								<div class="col-sm-3">
									<div class="row">
										<select class="form-control coupon-select" ng-change="ruleFn.changeCoupon(details.value, dv)" ng-model="dv.id" ng-options="item.id as item.name group by view.counponType[item.type] for item in view.coupons" required>
										</select>
									</div>
								</div>
								<div class="col-sm-3">
									<input type="number" min="1" class="form-control" ng-model="dv.count" required/>
									<input type="text" ng-modle="dv.name" style="display:none;">
								</div>
								<div class="pull-left form-control-static">张</div>
								<div class="col-sm-2 text-right">
									<a class="add click" ng-if="$first" ng-click="ruleFn.put(details, dv)"> <i class="glyphicon glyphicon-plus"></i>
									</a>
									<a class="remove click" ng-if="!$first" ng-click="ruleFn.resetCouponCntFn(details, dv)"> <i class="glyphicon glyphicon-remove"></i>
									</a>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-sm-3 btn btn-danger" ng-click="ruleFn.openOrClose()">新增券</div>
			<div class="form-group" ng-if="isOpenOrClose" >
				<div class="col-sm-12">
					<coupon-new add-ok="ruleFn.testAddOk(result)" add-fail="ruleFn.testAddFail(result)"></coupon-new>
				</div>
			</div>
		</div>
	</div>

	<div class="out ruleadd2">
		<div class="col-sm-2 text-right ">
			<span class="title">数量</span>
		</div>
		<div class="col-sm-10 content2 mb0">
			<div class="form-group mb22" >
				<div class=" form-control-static pull-left">前</div>
				<div class="col-sm-3 ">
					<input type="number" min="0" ng-model="posts.COUPON.COUPON.countLimit" class="form-control" placeholder="请输入人数限制" />
				</div>
				<div class=" form-control-static pull-left">
					人有效
					<span style="color:#999;padding-left:20px">(0表示不限制)</span>
				</div>
			</div>
		</div>
	</div>
